package fileReader.demo.reader;

import java.awt.geom.Point2D;
import java.util.Vector;


/**
 * Vertex is a point that can be used when defining map symbols
 */
public class Vertex
{
	private Point2D point;
	private Edge a;
	private Edge b;
	private DepthArea polygon;
	private Vector adj;
	private double cost;
	private Vertex predecessor;

    
    
    public Vertex(Point2D vertex, DepthArea polygon) {
		point = vertex;
    	this.a=null;
		this.b=null;
		this.polygon=polygon;
		adj = new Vector();
		cost = Double.MAX_VALUE;
		this.predecessor=null;
	}

    /**
     * Sets edge.
     * @param cedge edge one
     * @param cedge1 edge two
     */
    public void SetEdges(Edge cedge, Edge cedge1)
    {
        a = cedge;
        b = cedge1;
    }
    
    /**
     * Sets edge into adjacent vector.
     * @param cedge edge
     */
    public void SetAdjacent(Edge cedge)
    {
 	       adj.addElement(cedge);
    }

 
	/**
	 * @return Returns the polygon.
	 */
	public DepthArea getPolygon() {
		return polygon;
	}
	/**
	 * @param polygon The polygon to set.
	 */ /*
	public void setPolygon(DepthArea polygon) {
		this.polygon = polygon;
	}*/
	/**
	 * @return Returns the predecessor.
	 */
	public Vertex getPredecessor() {
		return predecessor;
	}
	/**
	 * @param predecessor The predecessor to set.
	 */
	public void setPredecessor(Vertex predecessor) {
		this.predecessor = predecessor;
	}
	
	/**
	 * @return Returns the x.
	 */
	public double getX() {
		return point.getX();
	}

	/**
	 * @return Returns the y.
	 */
	public double getY() {
		return point.getY();
	}

	/**
	 * @return Returns the cost.
	 */
	public double getCost() {
		return cost;
	}

	/**
	 * @param cost The cost to set.
	 */
	public void setCost(double cost) {
		this.cost = cost;
	}

	/**
	 * @return Returns the adj.
	 */
	public Vector getAdj() {
		return adj;
	}

}